const path = require("path");
const HtmlWebpackPlugin = require("html-webpack-plugin");
console.log(path.resolve(__dirname, "./src/index.ts"))
module.exports = {
    mode: "development",
    entry: {index: path.resolve(__dirname, "./src/index.ts")},
    output: {
        path: path.resolve(__dirname, "./dist"),
        filename: '[name].js'
    },
    resolve: {
        extensions: [".webpack.js", ".web.js", ".ts", ".tsx", ".js"]
    },
    devtool: "source-map",
    plugins: [
        new HtmlWebpackPlugin({
            chunks: ['index'],
            filename: "index.html",
            template: "./src/index.html"
        })
    ],
    devServer: {
        contentBase: './dist',
        port: 8090
    },
    module: {
        rules: [
            {
                test: /\.ts$/,
                use: "ts-loader"
            }
        ]
    }
}
;
